import QtQuick 1.0

Image {
    id: button

    property string name

    source: name ? "gfx/" + name + ".png" : ""

    signal clicked();

    MouseArea {
        anchors.fill: parent
        onPressed: {
            button.source = name ? "gfx/" + name + "_select.png" : ""
            parent.scale = 0.9
        }
        onReleased: {
            button.source = name ? "gfx/" + name + ".png" : ""
            parent.scale = 1
        }
        onClicked: button.clicked();
    }
}
